package top.superflow.core.semantic

import top.superflow.core.annotation.SemanticType
import top.superflow.lang.ArrayUtils

import scala.beans.BeanProperty
import scala.collection.Set

class SemanticData {

  @BeanProperty
  var mode : SemanticType = _
  
  @BeanProperty
  val keyWords : Set[String] = Set[String]()
  
  @BeanProperty
  val synonyms : Set[String] = Set[String]()
  
  @BeanProperty
  var description : String = _
  
  def setSynonym(synonyms : Set[String]){
    this.synonyms ++: synonyms
  }
  
  def setSynonym(synonyms : Array[String]){
    if(ArrayUtils.isEmpty(synonyms)){
      return
    }
    this.synonyms ++: synonyms
  }
  
  def setKeyWords(keyWords : Set[String]){
    this.keyWords ++: keyWords
  }
  
  def setKeyWords(keyWords : Array[String]){
    if(ArrayUtils.isEmpty(keyWords)){
      return
    }
    this.keyWords ++: keyWords
  }
}